﻿using System.Security.Permissions;
using System.Windows.Forms;
using System.Diagnostics;
using log4net.Core;
using System.Text;
using System;
using System.Threading;
using System.IO;
using EnvDTE;
using EnvDTE80;

namespace NHTrace
{
  /// <summary>
  /// Summary description for NHTraceToolWindowControl.
  /// </summary>
  public partial class NHTraceToolWindowControl : UserControl
  {
    public NHTraceToolWindowControl()
    {
      InitializeComponent();
    }

    /// <summary> 
    /// Let this control process the mnemonics.
    /// </summary>
    [UIPermission(SecurityAction.LinkDemand, Window = UIPermissionWindow.AllWindows)]
    protected override bool ProcessDialogChar(char charCode)
    {
      // If we're the top-level form or control, we need to do the mnemonic handling
      if (charCode != ' ' && ProcessMnemonic(charCode))
      {
        return true;
      }
      return base.ProcessDialogChar(charCode);
    }

    /// <summary>
    /// Enable the IME status handling for this control.
    /// </summary>
    protected override bool CanEnableIme
    {
      get
      {
        return true;
      }
    }

    private void webBrowserEx1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
      if (webBrowserEx1.Document.Body != null)
        webBrowserEx1.Document.Window.ScrollTo(0, webBrowserEx1.Document.Body.ScrollRectangle.Height);

    }

    public NHTracePackage Package { get; set; }
  }
}
